Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Xiaomi Smart Standing Fan 2 Pro (dmaker.fan.p33) #1467

Merged
merged 2 commits into from
Jul 18, 2022

Conversation

dainnilsson
Copy link
Contributor

@dainnilsson dainnilsson commented Jul 18, 2022

This adds support for the Xiaomi Smart Standing Fan 2 Pro. I've tested it and everything seems functional. I compared https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-p33:1 to the already supported https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:dmaker-p11:1 and from what I can tell they are functionally identical.

I noticed I get a warning: Found an unsupported model 'dmaker.fan.p33' for class 'FanMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/, but I'm not sure what constitutes a model being "supported", so I didn't do anything there. From looking at the source code, it doesn't look like any of the FanMiot devices are being added to _supported_models.

Edit: Looking at this some more I see that _models is used instead of _supported_models, and that the device is added to FanMiot.supported_models: FanMiot.supported_models dict_keys(['dmaker.fan.p9', 'dmaker.fan.p10', 'dmaker.fan.p11', 'dmaker.fan.p15', 'dmaker.fan.p18', 'dmaker.fan.p33']), so I'm not sure why the warning is still there.

Second Edit: Ok, nevermind. I see now that you always get the warning if you don't run fan.info() prior to running one of the other commands. User error! :)

Please let me know if I should change anything there!

Thanks for a great easy to use project!

@dainnilsson
Copy link
Contributor Author

Rebased on the latest commit from master.

@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2022

Codecov Report

Merging #1467 (1dc0acd) into master (dacccb3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1467   +/-   ##
=======================================
  Coverage   82.48%   82.48%           
=======================================
  Files         140      140           
  Lines       13898    13899    +1     
  Branches     3304     3304           
=======================================
+ Hits        11464    11465    +1     
  Misses       2214     2214           
  Partials      220      220           
Impacted Files Coverage Δ
miio/integrations/fan/dmaker/fan_miot.py 90.64% <100.00%> (+0.05%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Would you mind updating the supported devices list in the README.md for this device, and let's get this to the next release coming up tonight?

@rytilahti rytilahti changed the title Add dmaker.fan.p33. Add support for Xiaomi Smart Standing Fan 2 Pro (dmaker.fan.p33) Jul 18, 2022
@dainnilsson
Copy link
Contributor Author

README updated!

@rytilahti rytilahti merged commit 9666bd4 into rytilahti:master Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants